package com.TTBook.core.author.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AuthorCriteria {
    protected String orderByClause;

    protected List oredCriteria;

    public AuthorCriteria() {
        oredCriteria = new ArrayList();
    }

    protected AuthorCriteria(AuthorCriteria example) {
        this.orderByClause = example.orderByClause;
        this.oredCriteria = example.oredCriteria;
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public List getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ts_author
     *
     *  Wed Oct 16 00:21:25 CST 2013
     */
    public void clear() {
        oredCriteria.clear();
    }

    public static class Criteria {
        protected List criteriaWithoutValue;

        protected List criteriaWithSingleValue;

        protected List criteriaWithListValue;

        protected List criteriaWithBetweenValue;

        protected Criteria() {
            super();
            criteriaWithoutValue = new ArrayList();
            criteriaWithSingleValue = new ArrayList();
            criteriaWithListValue = new ArrayList();
            criteriaWithBetweenValue = new ArrayList();
        }

        public boolean isValid() {
            return criteriaWithoutValue.size() > 0
                || criteriaWithSingleValue.size() > 0
                || criteriaWithListValue.size() > 0
                || criteriaWithBetweenValue.size() > 0;
        }

        public List getCriteriaWithoutValue() {
            return criteriaWithoutValue;
        }

        public List getCriteriaWithSingleValue() {
            return criteriaWithSingleValue;
        }

        public List getCriteriaWithListValue() {
            return criteriaWithListValue;
        }

        public List getCriteriaWithBetweenValue() {
            return criteriaWithBetweenValue;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteriaWithoutValue.add(condition);
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("value", value);
            criteriaWithSingleValue.add(map);
        }

        protected void addCriterion(String condition, List values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("values", values);
            criteriaWithListValue.add(map);
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            List list = new ArrayList();
            list.add(value1);
            list.add(value2);
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("values", list);
            criteriaWithBetweenValue.add(map);
        }

        public Criteria andAuthoridIsNull() {
            addCriterion("AUTHORID is null");
            return this;
        }

        public Criteria andAuthoridIsNotNull() {
            addCriterion("AUTHORID is not null");
            return this;
        }

        public Criteria andAuthoridEqualTo(String value) {
            addCriterion("AUTHORID =", value, "authorid");
            return this;
        }

        public Criteria andAuthoridNotEqualTo(String value) {
            addCriterion("AUTHORID <>", value, "authorid");
            return this;
        }

        public Criteria andAuthoridGreaterThan(String value) {
            addCriterion("AUTHORID >", value, "authorid");
            return this;
        }

        public Criteria andAuthoridGreaterThanOrEqualTo(String value) {
            addCriterion("AUTHORID >=", value, "authorid");
            return this;
        }

        public Criteria andAuthoridLessThan(String value) {
            addCriterion("AUTHORID <", value, "authorid");
            return this;
        }

        public Criteria andAuthoridLessThanOrEqualTo(String value) {
            addCriterion("AUTHORID <=", value, "authorid");
            return this;
        }

        public Criteria andAuthoridLike(String value) {
            addCriterion("AUTHORID like", value, "authorid");
            return this;
        }

        public Criteria andAuthoridNotLike(String value) {
            addCriterion("AUTHORID not like", value, "authorid");
            return this;
        }

        public Criteria andAuthoridIn(List values) {
            addCriterion("AUTHORID in", values, "authorid");
            return this;
        }

        public Criteria andAuthoridNotIn(List values) {
            addCriterion("AUTHORID not in", values, "authorid");
            return this;
        }

        public Criteria andAuthoridBetween(String value1, String value2) {
            addCriterion("AUTHORID between", value1, value2, "authorid");
            return this;
        }

        public Criteria andAuthoridNotBetween(String value1, String value2) {
            addCriterion("AUTHORID not between", value1, value2, "authorid");
            return this;
        }

        public Criteria andAuthorNameIsNull() {
            addCriterion("AUTHOR_NAME is null");
            return this;
        }

        public Criteria andAuthorNameIsNotNull() {
            addCriterion("AUTHOR_NAME is not null");
            return this;
        }

        public Criteria andAuthorNameEqualTo(String value) {
            addCriterion("AUTHOR_NAME =", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameNotEqualTo(String value) {
            addCriterion("AUTHOR_NAME <>", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameGreaterThan(String value) {
            addCriterion("AUTHOR_NAME >", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameGreaterThanOrEqualTo(String value) {
            addCriterion("AUTHOR_NAME >=", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameLessThan(String value) {
            addCriterion("AUTHOR_NAME <", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameLessThanOrEqualTo(String value) {
            addCriterion("AUTHOR_NAME <=", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameLike(String value) {
            addCriterion("AUTHOR_NAME like", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameNotLike(String value) {
            addCriterion("AUTHOR_NAME not like", value, "authorName");
            return this;
        }

        public Criteria andAuthorNameIn(List values) {
            addCriterion("AUTHOR_NAME in", values, "authorName");
            return this;
        }

        public Criteria andAuthorNameNotIn(List values) {
            addCriterion("AUTHOR_NAME not in", values, "authorName");
            return this;
        }

        public Criteria andAuthorNameBetween(String value1, String value2) {
            addCriterion("AUTHOR_NAME between", value1, value2, "authorName");
            return this;
        }

        public Criteria andAuthorNameNotBetween(String value1, String value2) {
            addCriterion("AUTHOR_NAME not between", value1, value2, "authorName");
            return this;
        }

        public Criteria andAuthorIntroIsNull() {
            addCriterion("AUTHOR_INTRO is null");
            return this;
        }

        public Criteria andAuthorIntroIsNotNull() {
            addCriterion("AUTHOR_INTRO is not null");
            return this;
        }

        public Criteria andAuthorIntroEqualTo(String value) {
            addCriterion("AUTHOR_INTRO =", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroNotEqualTo(String value) {
            addCriterion("AUTHOR_INTRO <>", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroGreaterThan(String value) {
            addCriterion("AUTHOR_INTRO >", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroGreaterThanOrEqualTo(String value) {
            addCriterion("AUTHOR_INTRO >=", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroLessThan(String value) {
            addCriterion("AUTHOR_INTRO <", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroLessThanOrEqualTo(String value) {
            addCriterion("AUTHOR_INTRO <=", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroLike(String value) {
            addCriterion("AUTHOR_INTRO like", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroNotLike(String value) {
            addCriterion("AUTHOR_INTRO not like", value, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroIn(List values) {
            addCriterion("AUTHOR_INTRO in", values, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroNotIn(List values) {
            addCriterion("AUTHOR_INTRO not in", values, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroBetween(String value1, String value2) {
            addCriterion("AUTHOR_INTRO between", value1, value2, "authorIntro");
            return this;
        }

        public Criteria andAuthorIntroNotBetween(String value1, String value2) {
            addCriterion("AUTHOR_INTRO not between", value1, value2, "authorIntro");
            return this;
        }
    }
}